import {createRouter, createWebHistory, createWebHashHistory} from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  //history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: '/index',
      component: () => import('@/components/PageIndex'),
      //component: PageIndex,
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('@/components/PageIndex'),
      //component: PageIndex,
    },
    {
      path: '/custom',
      name: 'custom',
      component: () => import('@/components/PageCustom'),
      //component: PageIndex,
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('@/components/PageSearch'),
      //component: PageSearch,
      meta: {
        title: '搜索'
      }
    },
    {
      path: '/all',
      name: 'all',
      component: () => import('@/components/PageAll'),
      //component: PageSearch,
      meta: {
        title: '搜索'
      }
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('@/components/PageAbout'),
      //component: PageAbout,
      meta: {
        title: '搜索'
      }
    },
    {
      path: '/overall',
      name: 'overall',
      component: () => import('@/components/PageOverall'),
      //component: PageOverall,
      meta: {
        title: '大事件'
      }
    },
    {
      path: '/market',
      name: 'market',
      component: () => import('@/components/PageMarket'),
      //component: PageMarket,
      meta: {
        title: '市场数据'
      }
    },
    /*{
      path: '/examine',
      name: 'examine',
      component: () => import('@/components/PageExamineOverall'),
      //component: PageExamineOverall,
      meta: {
        title: '审核'
      }
    },
    {
      path: '/examine_attr_data',
      name: 'examine_attr_data',
      component: () => import('@/components/PageExamineAttrData'),
      //component: PageExamineAttrData,
      meta: {
        title: '审核'
      }
    },
    {
      path: '/examine_market',
      name: 'examine_market',
      component: () => import('@/components/PageExamineMarket'),
      //component: PageExamineMarket,
      meta: {
        title: '审核'
      }
    },
    {
      path: '/page_add',
      name: 'page_add',
      component: () => import('@/components/PageAdd'),
      //component: PageAdd,
      meta: {
        title: '添加'
      }
    },*/
    {
      path: '/add_suggest',
      name: 'add_suggest',
      component: () => import('@/components/PageAddSuggest'),
      //component: PageAdd,
      meta: {
        title: '添加'
      }
    },
    {
      path: '/entity_list',
      name: 'entity_list',
      component: () => import('@/components/PageEntityList'),
      //component: PageAdd,
      meta: {
        title: '添加'
      }
    },
    {
      path: '/customize',
      name: 'customize',
      component: () => import('@/components/PageCustomize'),
      //component: PageAdd,
      meta: {
        title: '添加'
      }
    },
    {
      path: '/entity_search',
      name: 'entity_search',
      component: () => import('@/components/PageEntitySearch'),
      //component: PageAdd,
      meta: {
        title: '添加'
      }
    },
    {
      path: '/entity_detail',
      name: 'entity_detail',
      component: () => import('@/components/PageEntityDetail'),
      //component: PageAdd,
      meta: {
        title: '添加'
      }
    },
    /*{
      path: '/login',
      name: 'login',
      component: () => import('@/components/PageLogin'),
      //component: PageLogin,
      meta: {
        title: '登录'
      }
    }*/
  ]
})
/*
router.beforeEach((to, from, next) => {
  if (window._hmt) {
    if (to.path) {
      window._hmt.push(['_trackPageview', '/#' + to.fullPath])
    }
  }
  next()
})
*/
/*
const statue = {
  path: '*',
  component:PageIndex
}

export function setAddRoutes() {
  let currentRoutes = router.options.routes
  currentRoutes.push(statue)
  router.addRoute(currentRoutes)
}
*/
export default router